package nutella89.basic;

public class Ex72_OOP {

	public static void main(String[] args) {
		// 객체 생성 및 객체 다루기
		Ex72_Retangle r = new Ex72_Retangle();
		System.out.println( r.width );
		System.out.println( r.height );
		System.out.println( r.color );
		
		r = new Ex72_Retangle(4, 40, "red");
		System.out.println( r.getArea() );
		System.out.println( r.getCircum() );

	} // main

} // class

class Ex72_Retangle {
	double width;
	double height;
	String color;
	
	public Ex72_Retangle() {
		// 생성자 : 객체 생성 및 멤버변수 초기화
		width = 1.0;
		height = 1.0;
		color = "white";
	}
	
	public Ex72_Retangle( double width, 
			double height, String color ) {
		this.width = width;
		this.height = height;
		this.color = color;
	} // 사용자 정의 생성자
	
	double getArea() {
		double area = width * height;
		return area;
	}
	
	double getCircum() {
		double circum = 
			(width * 2) + (height * 2);
		return circum;
	}
	
}













